Certain embodiments of the present invention relate generally to digital graphics processing. More specifically, certain embodiments relate to a method and apparatus for updating a color look-up table (CLUT).
Currently, several graphical image file formats exists. Some of these graphical image file formats may be machine dependent, operating system (OS) dependent or cross-platform independent. Notwithstanding, graphic image file format translators exists that may transform images from one file format to another. Some of the most popular graphical file format may include, but are not limited to, joint photographic expert group (JPEG), graphic interchange format (GIF), tagged image file format (TIFF), bitmap (BMP) and motion picture expert group (MPEG). JPEG, GIF, TIFF, and BMP, may generally be utilized for still graphic images, while MPEG may generally be utilized for moving graphic images.
It may often be necessary to reduce the size of an original image to ensure that any resulting image file may be small enough to require a minimal amount of storage. Additionally, the smaller the size of an image, the faster it may be transferred and/or displayed on a video display terminal. In general, graphic image file formats may incorporate some form of compression technique or scheme, which may effectively reduce the size of the image. These compression techniques may be lossy or lossless. Lossy compression techniques may reduce the size of an original image by removing actual image data from the original image. In this regard, a noticeable degradation may occur in the quality of any resulting image. Although, the resulting image may differ from the original image, in few instances, the difference may not be readily discernible by the human eye. Lossless compression techniques may reduce the size of an original image by utilizing certain algorithms that may permit the original image to be reproduced without any loss of the original image data. In this regard, the resulting image may differ from the original image, but in some instances, the difference may not be readily discernible.
Even though compression techniques may be used to compress graphic images, graphics processors may have to decompress some image file formats before actual images may be displayed on a display terminal such as a video display terminal. Significant amounts of processing power may be required, even in cases that may utilize dedicated graphics processing elements. These graphics processing elements may include, but are not limited to, graphics engines and graphics processors or coprocessors. A similar situation may apply in cases where the graphic image or data may not be in a compressed format.
To reduce processing requirements, some systems may utilize a color look-up table (CLUT). A CLUT may be a table stored in memory that may contain representative pixel information that may be utilized for reproduction and display of a graphic image. The CLUT may be viewed as a compression scheme in which pixel values for a bitmap image may be used as an index into a color translation table. Entries in the color translation table may define colors that may have more bits per pixel than the pixel values used to represent the bitmap image. For example, a system that utilizes four (4) bits to represent a pixel may have a CLUT with 24 or sixteen (16) possible values. However, there may be two (2) or more CLUTs, thereby extending the number of colors beyond sixteen (16) that may be represented by the four (4) bits. Similarly, a system that utilizes eight (8) bits to represent a pixel may have a CLUT with 28 or two hundred and fifty six (256) possible values. However, there may be two (2) or more CLUTs, thereby extending the number of colors that may be represented by the eight (8) bits significantly beyond two hundred and fifty six (256). In this case, if there are n CLUTs, then 256n colors may possibly be represented. Notwithstanding, one drawback with such a scheme would be the vast amount of memory that would be required to store the CLUT. Additionally, extensive amounts of processing power may be required to, for example, read and update the CLUT.
In systems that utilize a CLUT, buffers containing graphic data may be utilized for displaying a line of graphics at a time. In this regard, at least those portions of buffers containing information for a current line of graphics image data may be flushed or overwritten once a current line of graphics data has been displayed. The CLUT containing pertinent information about the pixels for the current line being displayed may only be updated after the information for the current line has been displayed. Hence, the CLUT containing information for the current line being displayed may not be updated prior to completion of the display of the current line, since doing so would result in at least a partial destruction of any existing graphic image being displayed. Accordingly, a need exists for an approach to update a color look-up table (CLUT) for a next line of graphics before the current line of graphics is finished being read out of a FIFO and processed for color.
Further limitations and disadvantages of conventional and traditional approaches will become apparent to one of skill in the art, through comparison of such systems with some aspects of the present invention as set forth in the remainder of the present application with reference to the drawings.
Embodiments of the present invention may provide a method and system for updating a color look-up table (CLUT) for a next line of graphics before a current line of graphics has been completely read out of a graphics FIFO and assigned color pixel values. The method may include the step of formatting or arranging the CLUT into a plurality of sub-CLUTs. Each one of the sub-CLUTs may include pixel color values for each one of a plurality of pixels which may include a line of the graphics image data. Pixel color values may be read from within a first selected sub-CLUT, the first selected sub-CLUT comprising pixel color values for a first line of the graphics image data. The read pixel color value may be applied to the current first line of the graphics image data. While the read pixel color value is being applied to the current first line, pixel color values for a second selected sub-CLUT may be updated. The second selected sub-CLUT may include color pixel values for a second line of the graphics image data.
The method may also include the step of assigning a corresponding CLUT index to each of the sub-CLUTs within the formatted CLUT and assigning a corresponding pixel data index to each of the pixel color values located with the sub-CLUT. The step of reading the pixel color value may further include the step of selecting the assigned sub-CLUT index of the sub-CLUT for the first line of graphics image data. The assigned pixel data index of the read pixel color value may be selected for the current line of the graphics image data.
The step of assigning a corresponding sub-CLUT index to each of the sub-CLUTs within the formatted CLUT may also include the step of assigning an n-bit value to represent a maximum number of the sub-CLUTs within the formatted CLUT. The maximum number of sub-CLUTs may be 2n, wherein n may be 4 or 8. The step of assigning a corresponding pixel data index to each of the pixel color values located within the sub-CLUT may further include the step of assigning an n-bit value to represent a maximum number of the pixel color values located with the sub-CLUT. The maximum number of the pixel color values may be 2n, where n may be 4 or 8.
Another aspect of the invention may include machine-readable storage, having stored thereon a computer program having a plurality of code sections executable by a machine for causing the machine to perform the above-mentioned steps.
Another embodiment of the invention may include a system for updating pixel colors in a color look-up-table (CLUT) being applied to graphics image data. The system may include a plurality of sub-CLUTs formatted within the CLUT. Each one of the plurality of sub-CLUTs may provide pixel color values for each one of a plurality of pixels comprising a line of the graphics image data. At least one reader may be adapted for reading pixel color values from within a first selected sub-CLUT. The first selected sub-CLUT may include pixel color values for a first line of the graphics image data. The at least one reader may be adapted to apply the read pixel color value to the current first line of the graphics image data. The at least one reader may also be configured to update pixel color values for a second selected sub-CLUT simultaneously with the at least one reader applying the read pixel color value to the current first line. The second selected sub-CLUT may include color pixel values for a second line of the graphics image data.
The system may also include a sub-CLUT index assigned to a corresponding one of each of the sub-CLUTs within the formatted CLUT. A sub-CLUT index may also be assigned to a corresponding one of each of the pixel color values located with the sub-CLUT. The system reader for reading the pixel color value may further include at least one selector for selecting the assigned CLUT index of the sub-CLUT for the first line of graphics image data. The selector may also be adapted to select the assigned sub-CLUT index of the read pixel color value for the current line of the graphics image data.
In accordance with the invention, the sub-CLUT index assigned to a corresponding one of each of the sub-CLUTs within the formatted CLUT, may further include an n-bit value assigned to represent a maximum number of the sub-CLUTS within the formatted CLUT. The maximum number of sub-CLUTS may be 2n, where n may be 4 or 8. The sub-CLUT index assigned to a corresponding one of each of the pixel color value located with the sub-CLUT may further include an n-bit value assigned to represent a maximum number of the pixel color values located with the sub-CLUT. The maximum number of pixel color values may be 2n, where n maybe 4 or 8.
These and other advantages, aspects and novel features of the present invention, as well as details of an illustrated embodiment thereof, will be more fully understood from the following description and drawings.